/*
 * Copyright (c) 2017, Iotelligent Corporation
 * All rights reserved.
 *
 * Description:
 *
 *   iBAT2000 main configuration file.
 */

#ifndef __IBAT2000_CONF_H__
#define __IBAT2000_CONF_H__

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <math.h>


#ifdef USE_FULL_ASSERT
/**
  * @brief  The assert_param macro is used for function's parameters check.
  * @param  expr: If expr is false, it calls assert_failed function which reports
  *         the name of the source file and the source line number of the call
  *         that failed. If expr is true, it returns no value.
  * @retval None
  */
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))

void assert_failed( uint8_t *file, uint32_t line )
{
    TRACE_INFO( "assert fail @ file: %s line %d\n", file, line );
}
#else
#define assert_param(expr) ((void)0)
#endif /* USE_FULL_ASSERT */

/* Debug level */
#ifdef DEBUG_OUTPUT
    #if DEBUG_MAIN_UART_OUTPUT
        #include "iot_host_if.h"

        #define TRACE_DEBUG(...)    dbg_info_printf(__VA_ARGS__)
    #else
        #define TRACE_DEBUG(...)    printf(__VA_ARGS__)
    #endif
#else
    #define TRACE_DEBUG(...)
#endif
#define TRACE_WARNING(...)  printf(__VA_ARGS__)
#define TRACE_ERROR(...)    printf(__VA_ARGS__)
#define TRACE_INFO(...)     printf(__VA_ARGS__)

#endif /* __IBAT2000_CONF_H__ */
